﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Liquid.Windows.Commands.ToolStrips {
	public class ToolStripItemCommandBinding : CommandBinding {
		public ToolStripItemCommandBinding(ToolStripItem item) { this.Item = item; }

		public ToolStripItem Item { get; protected set; }

		protected internal override void OnTextChanged(EventArgs e) {
			Item.Text = Command.Text;
			base.OnTextChanged(e);
		}
		protected internal override void OnImageChanged(EventArgs e) {
			Item.Image = Command.DefaultImage;
			base.OnImageChanged(e);
		}
		protected internal override void OnEnabledChanged(EventArgs e) {
			Item.Enabled = Command.Enabled;
			base.OnEnabledChanged(e);
		}
		protected internal override void OnToolTipTextChanged(EventArgs e) {
			Item.ToolTipText = Command.ToolTipText;
			base.OnToolTipTextChanged(e);
		}
	}
}
